package com.woniuxy.creditsystem.dashboardmag.service.impl;

import com.woniuxy.creditsystem.common.bean.DashboardInfo;
import com.woniuxy.creditsystem.common.bean.OrderMoneyInfo;
import com.woniuxy.creditsystem.common.bean.ReturnMoneyCount;
import com.woniuxy.creditsystem.common.mapper.DashboardInfoMapper;
import com.woniuxy.creditsystem.common.mapper.PutMoneyInfoMapper;
import com.woniuxy.creditsystem.dashboardmag.service.IDashboardInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ：pengchufeng
 * @date ：Created in 2020/12/16
 * @description：仪表盘信息service接口实现
 */
@Transactional(readOnly = true)
@Service
public class DashboardInfoImpl implements IDashboardInfo {

    @Resource
    private DashboardInfoMapper dashboardInfoMapper;


    /**
     * 无条件查询所有放款信息
     * @Param dashboardInfo 条件
     * @return
     */
    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public List<DashboardInfo> findAll(DashboardInfo dashboardInfo) {
        return dashboardInfoMapper.findAll(dashboardInfo);
    }

    /**
     * 无条件查询所有放款信息
     * @Param dashboardInfo 条件
     * @return
     */
    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public List<DashboardInfo> findFirst(DashboardInfo dashboardInfo) {
        return dashboardInfoMapper.findFirst(dashboardInfo);
    }

    /**
     * 无条件查询所有放款信息
     * @Param dashboardInfo 条件
     * @return
     */
    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public List<ReturnMoneyCount> findCount(@Param("returnMoneyCount")ReturnMoneyCount returnMoneyCount){
        return dashboardInfoMapper.findCount(returnMoneyCount);
    }

    /**
     * 无条件查询所有放款信息
     * @Param dashboardInfo 条件
     * @return
     */
    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public List<ReturnMoneyCount> findBill(@Param("returnMoneyCount")ReturnMoneyCount returnMoneyCount){
        return dashboardInfoMapper.findBill(returnMoneyCount);
    }

    /**
     * 无条件查询所有放款信息
     * @Param dashboardInfo 条件
     * @return
     */
    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public List<OrderMoneyInfo> findOM(@Param("orderMoneyInfo")OrderMoneyInfo orderMoneyInfo){
        return dashboardInfoMapper.findOM(orderMoneyInfo);
    }
}
